﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "GcmpDevService.h"
#include "GbmpQuickCast.h"


namespace gcmp
{
    /// \brief AECORE数据埋点组件
    class GCMP_DEV_SERVICE_EXPORT IAecoreDataTrackingComponent
    {
        DEFINE_CAST_BASE(IAecoreDataTrackingComponent);
    public:
        /// \brief 获取IAecoreDataTrackingComponent实例
        /// \return 得到的IAecoreDataTrackingComponent实例
        static IAecoreDataTrackingComponent* Get();

        /// \brief 注册IAecoreDataTrackingComponent实例
        /// \param pAcoreDataTracingComponent正在注册的实例
        /// \return 老的实例
        static IAecoreDataTrackingComponent* Register(IAecoreDataTrackingComponent* pAecoreDataTrackingComponent);

        /// \brief 反注册实例
        /// \return void
        static void Unregister();

    public:
        /// \brief 将DebugWarn的信息上传到AECORE埋点服务器
        /// \param fileName 文件名
        /// \param lineNumber 行号
        /// \param functionName 函数名
        /// \param text 说明信息
        /// \param name 姓名
        /// \param date 日期
        /// \void
        virtual void UploadDebugWarnMessageToGux(const std::string& fileName, int lineNumber, const std::string& functionName, const std::wstring& text, const std::wstring& name, const std::wstring& date) = 0;

        /// \brief 设置重复的DebugWarn信息，只上传一次
        /// \param onlyOnce true:只上传一次； false：每次都上传；默认为false，即每次都上传
        /// \return void
        virtual void SetUploadOnlyOnce(bool onlyOnce) = 0;

        /// \brief判断重复的DebugWarn信息是否只上传一次
        /// \return bool true:表示只上传一次；false:表示每次都上传
        virtual bool IsUploadOnlyOnce() = 0;

    private:
        static IAecoreDataTrackingComponent* m_aecoreDataTrackingComponent;
    };
}


